﻿namespace Reap.AzureResource.API
{
	using System.Web;
	using System.Web.Http;
	using System.Web.Http.Hosting;
	using System.Web.Http.WebHost;

	using Reap.EmailServer;

	public class WebApiApplication : HttpApplication
	{
		#region Methods

		protected void Application_Start()
		{
			GlobalConfiguration.Configure(WebApiConfig.Register);
			GlobalConfiguration.Configuration.Services.Replace(typeof(IHostBufferPolicySelector), new CustomPolicy());

			EmailHelper.Init();
		}

		#endregion
	}

	public class CustomPolicy : WebHostBufferPolicySelector
	{
		#region Public Methods and Operators

		public override bool UseBufferedInputStream(object hostContext)
		{
			return false;
		}

		#endregion
	}
}